package site.xuqing.autohelper.bean;

import android.os.Bundle;

import site.xuqing.autohelper.StepScript;
import site.xuqing.autohelper.type.StepType;

public class StepBean {
    /**
     * 步骤名称
     */
    private String stepName;
    /**
     * 当前步骤的界面包类名
     */
    private String currentScreenActivityClassName;
    /**
     * 操作方式
     * -1.自定义步骤；1.单击；2.长按；3.上滑；4.下滑；5.左滑；6.右滑；7.复制；8.粘贴；9.返回；10.rect单击；11.rect长按
     * 2.单击，长按必须传递operateInfo
     * 3.滑动不需要传递operateInfo
     * 4.当有粘贴动作时，如果不传pasteText，必须先有复制动作
     * 5.如果传递pasteText，粘贴动作便可直接粘贴pasteText内容
     */
    private StepType stepType;
    /*
     * 当前操作实际对象信息
     */
    private StepInfoBean stepInfo;
    /**
     * 可辨别的唯一当前操作实际对象的父对象信息，用以对于查找到多个相同的操作种类的情况作为范围确定精准辨别
     */
    private StepInfoBean stepInfoParent;
    /**
     * 可辨别的唯一当前操作实际对象的子对象信息，用以对于查找到多个相同的操作种类的情况作为范围确定精准辨别
     */
    private StepInfoBean stepInfoChild;
    /**
     * 需要粘贴的文本
     * 该字段不为空时，粘贴动作直接粘贴该文本
     */
    private String pasteText;
    /**
     * 步骤间隔时长，单位毫秒
     */
    private long taskTime = 1000;
    /**
     * 是否是循环步骤的开始
     */
    private boolean loopStart;
    /**
     * 是否是循环步骤的结束
     */
    private boolean loopEnd;
    /**
     * 循环次数，值小于等于0均为无限循环
     */
    private int loopTimes;
    /**
     * 处理当前自定义步骤缺少的步骤
     */
    private StepScript stepScript;
    /**
     * 数据监听
     */
    private StepListener stepListener;

    public StepBean() {
    }

    public StepBean(StepType stepType) {
        this.stepType = stepType;
    }

    public StepBean(StepType stepType,String currentScreenActivityClassName) {
        this.currentScreenActivityClassName=currentScreenActivityClassName;
        this.stepType = stepType;
    }

    public String getStepName() {
        return stepName;
    }

    public StepBean setStepName(String stepName) {
        this.stepName = stepName;
        return this;
    }

    public String getCurrentScreenActivityClassName() {
        return currentScreenActivityClassName;
    }

    public StepBean setCurrentScreenActivityClassName(String currentScreenActivityClassName) {
        this.currentScreenActivityClassName = currentScreenActivityClassName;
        return this;
    }

    public StepType getStepType() {
        return stepType;
    }

    public StepBean setStepType(StepType stepType) {
        this.stepType = stepType;
        return this;
    }

    public StepInfoBean getStepInfo() {
        return stepInfo;
    }

    public StepBean setStepInfo(StepInfoBean stepInfo) {
        this.stepInfo = stepInfo;
        return this;
    }

    public StepInfoBean getStepInfoParent() {
        return stepInfoParent;
    }

    public StepBean setStepInfoParent(StepInfoBean stepInfoParent) {
        this.stepInfoParent = stepInfoParent;
        return this;
    }

    public StepInfoBean getStepInfoChild() {
        return stepInfoChild;
    }

    public StepBean setStepInfoChild(StepInfoBean stepInfoChild) {
        this.stepInfoChild = stepInfoChild;
        return this;
    }

    public String getPasteText() {
        return pasteText;
    }

    public StepBean setPasteText(String pasteText) {
        this.pasteText = pasteText;
        return this;
    }

    public long getTaskTime() {
        return taskTime;
    }

    public StepBean setTaskTime(long taskTime) {
        this.taskTime = taskTime;
        return this;
    }

    public boolean isLoopStart() {
        return loopStart;
    }

    public StepBean setLoopStart(boolean loopStart) {
        this.loopStart = loopStart;
        return this;
    }

    public boolean isLoopEnd() {
        return loopEnd;
    }

    public StepBean setLoopEnd(boolean loopEnd) {
        this.loopEnd = loopEnd;
        return this;
    }

    public int getLoopTimes() {
        return loopTimes;
    }

    public StepBean setLoopTimes(int loopTimes) {
        this.loopTimes = loopTimes;
        return this;
    }

    public StepScript getStepScript() {
        return stepScript;
    }

    public StepBean setStepScript(StepScript stepScript) {
        this.stepScript = stepScript;
        return this;
    }

    public StepListener getStepListener() {
        return stepListener;
    }

    public StepBean setStepListener(StepListener stepListener) {
        this.stepListener = stepListener;
        return this;
    }

    public interface StepListener{
        void out(Bundle bundle);
        Bundle in();
    }
}
